package controlLayer;
import modelLayer.*;
import tuiLayer.*;
public class LoanController
{
  private LoanContainer loanCon; 
  private PersonCtrl personCon;
  private DVDController dvdCon;
  private LoanUI loanui;
  public LoanController()
  {
      loanCon = LoanContainer.getInstance();
      personCon = new PersonCtrl();
      dvdCon = new DVDController();
      loanui = new LoanUI();
  }
  public void createLoan(int id, String borrowDate,String period,String state, DVD dvd, Person person)
  {   
       loanCon.createLoan(id,borrowDate,period,state,person,dvd);      
  }
  public DVD getdvd(String title)
  {
      return dvdCon.findDvdforloan(title);   
  }
  public Person getPerson(String phone)
  {
      return personCon.getPerson(phone);
    }
  public void findLoan(String phone)
  {      
      loanCon.findLoan(phone);
  }
  public Loan getLoan(String Phone)
  {
      return loanCon.getLoan(Phone);
  }
  public void deleteLoan(String phone)
  {
      loanCon.deleteLoan(phone);
  }
  public void updateLoan(String phone, String period)
  {
       loanCon.updateLoan(phone,period);       
  }
}
